package com.user.application.query.dto;

import com.common.aes.EncoderUtil;
import com.common.sensitive.DesensitizationStrategy;
import com.common.sensitive.Sensitive;
import lombok.Data;

/**
 * @author 大忽悠
 * @create 2022/9/28 18:36
 */
@Data
public class UserDto {

    private Integer id;

    @Sensitive(strategy = DesensitizationStrategy.USERNAME)
    private String username;

    @Sensitive(strategy = DesensitizationStrategy.PASSWORD)
    private String password;

    private String headImg;

    private String ipAddr;

    private String selfInformation;

    private Integer signInNum;

    public void setPassword(String password) {
        this.password = EncoderUtil.decodeWithPrefixOrEncode(password);
    }
}
